<!DOCTYPE html>
<html lang="zh_CN" xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">

<head>
    <title th:text="${pageTitle}"></title>
    <div data-th-replace="layout/head-top"></div>
</head>

<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInLeft">
        <div data-th-replace="common/functionDepict"></div>
        <div>
            <div class="row">
                <div class="pt10">
                    <div class="col-sm-9">
                        <div class="ibox float-e-margins">
                            <div class="ibox-title">
                                <h5>填写基本信息</h5>
                            </div>
                            <form id="saveCouponFrom" >
                                <div class="ibox-content">
                                <div class="form-horizontal">
                                    <div class="alert alert-info alert-dismissable ">
                                        <span><i class="fa fa-lightbulb-o"></i> 前台用户账户充值时不享受任何优惠券折扣</span>
                                    </div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label text-right"><i class="c-red">*</i> 优惠券名称</label>
                                        <div class="col-sm-8">
                                            <input class="form-control validate-data" name="title" value="" type="text">
                                            <span class="help-block m-b-none c-999"> 优惠券名称</span>
                                        </div>
                                    </div>
                                    <div class="hr-line-dashed"></div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label text-right"><i class="c-red">*</i> 优惠券数量</label>
                                        <div class="col-sm-8">
                                            <input class="form-control validate-data" maxlength="6" name="codeNum" onkeyup="this.value=this.value.replace(/\D/g,'')" value="" type="text">
                                            <span class="help-block m-b-none c-999"> 新建实际上是建设一个批次，里面包含很多张</span>
                                        </div>
                                    </div>
                                    <div class="hr-line-dashed"></div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label text-right"><i class="c-red">*</i> 优惠券类型</label>
                                        <div class="col-sm-8">
                                            <div class="radio i-checks">
                                                <label><input type="radio"  checked="" value="1" name="type"> <i></i> 折扣券</label>
                                                <label><input type="radio"  value="2" name="type"> <i></i> 定额券</label>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="hr-line-dashed"></div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label text-right"><i class="c-red">*</i> 优惠券金额</label>
                                        <div class="col-sm-8">
                                            <div class="input-group m-b ">
                                                <span class="input-group-addon discountCoupon"><i class="fa fa-tag"></i></span>
                                                <input class="form-control validate-data" name="limitAtion" value="" type="text">
                                                <span class="input-group-addon fixedCoupon">折</span>
                                            </div>
                                            <span class="help-block m-b-none c-999">  定额券只能输入正整数，如：50；折扣券，如：8.9折,填写的折扣不能大于等于10</span>
                                        </div>
                                    </div>
                                    <div class="hr-line-dashed"></div>
                                    <div class="form-group openCourse" style="display: none">
                                        <label class="col-sm-2 control-label text-right">&nbsp;</label>
                                        <div class="col-sm-9">
                                            <p>
                                                <input type="hidden" value="" name="openCourseIds"/>
                                                <button class="btn btn-primary " id="selectOpenCourse" type="button"><i class="fa fa-plus"></i> &nbsp;选择免费直播</button>
                                                <span class="ml10"><small class="fs12 c-red"><i class="fa fa-lightbulb-o"></i> 购买选定课程才能使用此类优惠券</small></span>
                                            </p>
                                            <div class="pt10 hide" id="courseOpen-content-table-hd">
                                                <table class="table table-bordered table-hover">
                                                    <thead>
                                                    <tr>
                                                        <th class="text-center">ID</th>
                                                        <th>公共课名称</th>
                                                        <th>专业/科目</th>
                                                        <th class="text-center">上课时间</th>
                                                        <th class="text-center">操作</th>
                                                    </tr>
                                                    </thead>
                                                    <tbody id="courseOpen-content">

                                                    </tbody>
                                                </table>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="hr-line-dashed openCourse" style="display: none"></div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label text-right"><i class="c-red">*</i> 使用条件</label>
                                        <div class="col-sm-8">
                                            <div>
                                                <div class="radio i-checks">
                                                    <label><input type="radio"  checked="" value="1" name="settingStatus"> <i></i> 设置</label>
                                                    <label><input type="radio"  value="2" name="settingStatus"> <i></i> 不设置</label>
                                                </div>
                                                <span class="help-block m-b-none c-999"><i class="fa fa-lightbulb-o"></i> 设置：此优惠券前台使用有对应条件限制。不设置：此优惠券前台无使用条件限制。</span>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="hr-line-dashed"></div>
                                    <div class="shop-data-box form-group">
                                        <label class="col-sm-2 control-label text-right">商品设置</label>
                                        <div class="col-sm-9">
                                            <div class="m-t-sm">
                                                <div class="alert alert-info">
                                                    <span>1、当选定的商品在购买时可使用此类优惠券，不选择时默认为对应商品不可使用。</span>
                                                </div>
                                            </div>
                                            <div class="m-t">
                                                <p>
                                                    <input type="hidden" id="courseIds" name="courseIds" value=""/>
                                                    <button class="btn btn-outline btn-primary" id="selectCourse" type="button"><i class="fa fa-plus"></i> &nbsp;选择课程</button>
                                                </p>
                                                <div class="pt10 hide" id="course-content-table-hd">
                                                    <table class="table table-bordered table-hover">
                                                        <thead>
                                                        <tr>
                                                            <th class="text-center">ID</th>
                                                            <th>课程名称</th>
                                                            <th>价格</th>
                                                            <th class="text-center">操作</th>
                                                        </tr>
                                                        </thead>
                                                        <tbody id="course-content"></tbody>
                                                    </table>
                                                </div>
                                            </div>
                                            <div class="m-t">
                                                <p>
                                                    <input type="hidden" id="examIds" name="examIds" value=""/>
                                                    <button class="btn btn-outline btn-primary" id="selectExam" type="button"><i class="fa fa-plus"></i> &nbsp;选择试卷</button>
                                                </p>
                                                <div class="pt10 hide" id="exam-content-table-hd">
                                                    <table class="table table-bordered table-hover">
                                                        <thead>
                                                        <tr>
                                                            <th class="text-center">ID</th>
                                                            <th>试卷名称</th>
                                                            <th>价格</th>
                                                            <th class="text-center">操作</th>
                                                        </tr>
                                                        </thead>
                                                        <tbody id="exam-content"></tbody>
                                                    </table>
                                                </div>
                                            </div>
                                            <div class="m-t">
                                                <p>
                                                    <input type="hidden" id="bookIds" name="bookIds" value=""/>
                                                    <button class="btn btn-outline btn-primary" id="selectBook" type="button"><i class="fa fa-plus"></i> &nbsp;选择图书</button>
                                                </p>
                                                <div class="pt10 hide" id="book-content-table-hd">
                                                    <table class="table table-bordered table-hover">
                                                        <thead>
                                                        <tr>
                                                            <th class="text-center">ID</th>
                                                            <th>图书名称</th>
                                                            <th>价格</th>
                                                            <th class="text-center">操作</th>
                                                        </tr>
                                                        </thead>
                                                        <tbody id="book-content"></tbody>
                                                    </table>
                                                </div>
                                            </div>
                                            <div class="m-t">
                                                <p>
                                                    <input type="hidden" id="memberIds" name="memberIds" value=""/>
                                                    <button class="btn btn-outline btn-primary" id="selectMember" type="button"><i class="fa fa-plus"></i> &nbsp;选择会员</button>
                                                </p>
                                                <div class="pt10 hide" id="member-content-table-hd">
                                                    <table class="table table-bordered table-hover">
                                                        <thead>
                                                        <tr>
                                                            <th class="text-center">ID</th>
                                                            <th>会员名称</th>
                                                            <th>价格</th>
                                                            <th class="text-center">操作</th>
                                                        </tr>
                                                        </thead>
                                                        <tbody id="member-content"></tbody>
                                                    </table>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="shop-data-box form-group">
                                        <label class="col-sm-2 control-label text-right">其它设置</label>
                                        <div class="col-sm-9">
                                            <section>
                                                <div class="checkbox i-checks">
                                                    <label><input type="checkbox" name="qaUse"/> 关联问答业务</label>
                                                    <span class=" m-b-none c-999 m-l">  勾选后，当学员在前台付费提问时可使用此类优惠券</span>
                                                </div>
                                            </section>
                                            <section>
                                                <div class="checkbox i-checks">
                                                    <label><input type="checkbox" name="attendUse"/> 关联问答围观业务</label>
                                                    <span class=" m-b-none c-999 m-l">  勾选后，当学员在前台1元围观时可使用此类优惠券</span>
                                                </div>
                                            </section>
                                        </div>
                                    </div>
                                    <div class="shop-data-box hr-line-dashed"></div>

                                    <div class="form-group">
                                        <label class="col-sm-2 control-label text-right"><i class="c-red">*</i> 限定消费金额</label>
                                        <div class="col-sm-8">
                                            <div class="input-group m-b"><span class="input-group-addon"><i class="fa fa-cny"></i></span>
                                                <input class="form-control validate-data" name="minAmount" value="" type="text" placeholder="只能填写正整数"> <span class="input-group-addon">元</span>
                                            </div>
                                            <span class="help-block m-b-none c-red">  订单金额必须大等于此金额时才能使用此优惠券</span>
                                        </div>
                                    </div>
                                    <div class="hr-line-dashed"></div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label text-right"><i class="c-red">*</i> 使用时间</label>
                                        <div class="col-sm-10">
                                            <div>
                                                <div class="radio i-checks">
                                                    <label><input type="radio"  checked="" value="1" name="timeType"> <i></i> 自定义</label>
                                                    <label><input type="radio"  value="2" name="timeType"> <i></i> 不限</label>
                                                </div>
                                                <div class="clearfix m-t timeType">
                                                    <div class="pull-left" style="width: 240px">
                                                        <input id="startDate" name="beginTime" value="" class="laydate-icon form-control layer-date validate-data" placeholder="请输入开始时间" onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})">
                                                    </div>
                                                    <div class="pull-left mt10">
                                                        <span class="c-999 fs14">&nbsp_&nbsp</span>
                                                    </div>
                                                    <div class="pull-left" style="width: 240px">
                                                        <input id="endDate" name="endTime" value="" class="laydate-icon form-control layer-date validate-data" placeholder="请输入结束时间" onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})">
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="hr-line-dashed "></div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label"><i class="c-red">*</i>  备注说明</label>
                                        <div class="col-sm-9">
                                            <textarea class="form-control" required="" name="summary" aria-required="true" placeholder="关于优惠券的备注说明"></textarea>
                                            <span class="help-block m-b-none c-999"> 举例：我建立 这个批次的优惠券，不要乱触碰。或者这是为十一活动专门设置的优惠券。</span>
                                        </div>
                                    </div>
                                    <div class="hr-line-dashed"></div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label text-right">推广设置</label>
                                        <div class="col-sm-9">
                                            <section class="">
                                                <ul class="nav nav-tabs wNav-tabs" id="receive-type">
                                                    <li class="active" data-type="1"><a class="fs14" data-toggle="tab" href="#tab-1" aria-expanded="true"> 用户领取</a></li>
                                                    <li class="" data-type="2"><a class="fs14" data-toggle="tab" href="#tab-2" aria-expanded="false"> 定向发放</a></li>
                                                </ul>
                                                <div class="tab-content m-t">
                                                    <div id="tab-1" class="tab-pane active">
                                                        <div class="panel-body">
                                                            <div class="checkbox i-checks">
                                                                <label>
                                                                    <input type="checkbox" disabled checked/>
                                                                    <b>用户可在商品详情页面领取</b>
                                                                </label>
                                                                <a href="javascript:;" class="c-master m-l"
                                                                      data-container="body"
                                                                      data-html="true"
                                                                      data-toggle="popover"
                                                                      data-trigger="hover"
                                                                      data-placement="top"
                                                                      th:attrappend="data-content='<img width=380 src='+${staticPath}+'/admin/v3/img/pic/yhCard-img.jpg />'">
                                                                    示例</a>
                                                                <span class="help-block m-b-none c-999 m-l m-t-sm">  勾选后，优惠券将在商品详情页进行展示，访问页面的用户可直接领取</span>
                                                            </div>
                                                        </div>
                                                    </div>
                                                    <div id="tab-2" class="tab-pane">
                                                        <div class="panel-body">
                                                            <div class="radio i-checks">
                                                                <label><input type="radio" checked value="1" name="orientType"> <i></i> 针对用户</label>
                                                                <label><input type="radio"  value="2" name="orientType"> <i></i> 针对场景</label>
                                                            </div>
                                                            <div class="hr-line-dashed"></div>
                                                            <section class="m-t">
                                                                <!--针对用户-->
                                                                <div id="orient-type-user">

                                                                    <div class="alert alert-info">
                                                                        <span>1、创建的优惠券定向发放人群时，前台移动各端在进入个人中心会主动弹出框领取优惠券。</span>
                                                                        <a href="javascript:;" class="c-master m-l"
                                                                           data-container="body"
                                                                           data-html="true"
                                                                           data-toggle="popover"
                                                                           data-trigger="hover"
                                                                           data-placement="top"
                                                                           th:attrappend="data-content='<img width=300 src='+${staticPath}+'/admin/v3/img/pic/couponModal-img.jpg />'">
                                                                        示例
                                                                        </a>
                                                                        <br>
                                                                        <span>2、当用户点击“有钱任性，不需要”按钮后，弹出框将间隔24小时后，再次主动弹出。</span>
                                                                        <br>
                                                                        <span>3、前台各端优惠券页面，增加领券按钮，用户主动触发按钮后也将会弹出框领取优惠券。无优惠券可领取时将不再弹出。</span>
                                                                    </div>

                                                                    <div class="radio i-checks">
                                                                        <label><input type="radio" checked value="1" name="userType"> <i></i> 添加全部用户</label>
                                                                    </div>
                                                                    <div class="radio i-checks">
                                                                        <label><input type="radio" value="2" name="userType"> <i></i> 添加部分用户</label>
                                                                    </div>
                                                                    <section id="part-user-type-box" class="m-t hide">
                                                                        <!--选择为添加部分用户时-->
                                                                        <div>
                                                                            <button class="btn btn-outline btn-primary" id="course-btn" type="button">
                                                                                <i class="fa fa-plus"></i> &nbsp;添加指定课程付费用户
                                                                            </button>
                                                                            <!--<button class="btn btn-outline btn-primary m-l" type="button">
                                                                                <i class="fa fa-plus"></i> &nbsp;添加用户人群
                                                                            </button>-->
                                                                        </div>
                                                                        <div class="m-t m-l m-r" id="course-box">
                                                                        </div>
                                                                        <div class="mt10">
                                                                            <button class="btn btn-outline btn-primary" id="exam-btn" type="button">
                                                                                <i class="fa fa-plus"></i> &nbsp;添加指定试卷付费用户
                                                                            </button>
                                                                        </div>
                                                                        <div class="m-t m-l m-r" id="exam-box">
                                                                        </div>
                                                                        <div class="mt10">
                                                                            <button class="btn btn-outline btn-primary" id="book-btn" type="button">
                                                                                <i class="fa fa-plus"></i> &nbsp;添加指定图书付费用户
                                                                            </button>
                                                                        </div>
                                                                        <div class="m-t m-l m-r" id="book-box">
                                                                        </div>
                                                                        <div class="mt10">
                                                                            <button class="btn btn-outline btn-primary" id="member-btn" type="button">
                                                                                <i class="fa fa-plus"></i> &nbsp;添加指定会员付费用户
                                                                            </button>
                                                                        </div>
                                                                        <div class="m-t m-l m-r" id="member-box">
                                                                        </div>
                                                                    </section>
                                                                </div>
                                                                <!--针对场景-->
                                                                <div id="orient-type-scene" class="hide">
                                                                    <div class="radio i-checks" id="couponCondition">
                                                                        <p><label><input type="radio" checked value="1" name="conditions"> <i></i> 手动发放</label></p>
                                                                        <p><label><input type="radio"  value="2" name="conditions"> <i></i> 新用户注册后自动获取</label></p>
                                                                        <p><label><input type="radio"  value="3" name="conditions"> <i></i> 学员生日获取</label></p>
                                                                        <p><label><input type="radio"  value="5" name="conditions"> <i></i> 消费任意金额获取</label></p>
                                                                        <p><label><input type="radio"  value="7" name="conditions"> <i></i> 活动发放</label></p>
                                                                        <p><label><input type="radio"  value="11" name="conditions"> <i></i> 积分兑换</label></p>
                                                                    </div>
                                                                </div>
                                                            </section>
                                                        </div>
                                                    </div>
                                                </div>
                                            </section>
                                        </div>
                                    </div>
                                    <div class="hr-line-dashed"></div>
                                    <div class="form-group">
                                        <div class="col-sm-4 col-sm-offset-2">
                                            <button class="btn btn-danger" id="submitSaveCoupon" type="button">保存,创建</button>
                                            <button class="btn btn-white ml10" id="onBack" type="button">取消</button>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            </form>
                        </div>
                    </div>
                    <div data-th-replace="common/importantNotes"></div>
                </div>
        </div>
    </div>
    </div>
    <div data-th-replace="layout/head-footer"></div>
    <script type="text/javascript" th:src="@{{path}/admin/business/course/cou/select-common-course.js?v={v}(path=${staticPath},v=${v})}"></script>
    <script type="text/javascript" th:src="@{{path}/admin/business/exam/paper/select-common-exam.js?v={v}(path=${staticPath},v=${v})}"></script>
    <script type="text/javascript" th:src="@{{path}/admin/business/course/book/select_common_book.js?v={v}(path=${staticPath},v=${v})}"></script>
    <script type="text/javascript" th:src="@{{path}/admin/business/user/member/select-common-member.js?v={v}(path=${staticPath},v=${v})}"></script>
    <script type="text/javascript" th:src="@{{path}/admin/business/course/open/common-open-course.js?v={v}(path=${staticPath},v=${v})}"></script>
    <script type="text/javascript" th:src="@{{path}/admin/business/op/coupon/coupon_create.js?v={v}(path=${staticPath},v=${v})}"> </script>
    <script type="text/javascript" th:src="@{{path}/admin/libs/plugins/layer/laydate/laydate.js?v={v}(path=${staticPath},v=${v})}"></script>
</body>
</html>
